import { request } from "../request";

/** 获取iqiyi */
export const fetchIqiyi = async (
	input: Seckill.GetIQIYISeckillInput | null,
) => {
	const data = await request.post<Seckill.IQIYISeckill[] | null>(
		"/seckill/get-iqiyi",
		input,
	);
	return data;
};

/** 新增修改iqiyi */
export const AddOrUpdateIQIYISeckill = async (
	input: Seckill.AddOrUpdateIQIYISeckillInput | null,
) => {
	const data = await request.post<Seckill.IQIYISeckill | null>(
		"/seckill/addOrUpdateIqiyi",
		input,
	);
	return data;
};

/** 删除iqiyi */
export const DelIQIYISeckill = async (seckillId: number) => {
	const data = await request.delete("/seckill/iqiyi/" + seckillId);
	return data;
};

/** 同步爱奇艺秒杀 */
export const SyncIQIYISeckill = async (actCode: string) => {
	const data = await request.get("/seckill/iqiyi/sync?actCode=" + actCode);
	return data;
};
